﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.TenantManagement;

namespace BackendAdminApp.Host.Controllers
{
    [Authorize]
    [ApiController]
    [Route("api/multi-tenancy")]
    public class MultiTenancyController : AbpController
    {
        private readonly ITenantAppService _tenantAppService;

        public MultiTenancyController(ITenantAppService tenantAppService)
        {
            _tenantAppService = tenantAppService;
        }

        [HttpGet]
        [Route("tenants")]
        public Task<PagedResultDto<TenantDto>> GetIdentityUsersAsync([FromQuery] GetTenantsInput input)
        {
            return _tenantAppService.GetListAsync(input);
        }
    }
}
